<?php
class ScheduleModel extends Model
{
	//将规则传来的数据格式化后添加 
	public function formatAdd($mission,$integral){
		$data=[];
		$data['datatime']=time();
		$data['member_id']=$mission['approver_id'];
		$data['membername']=$mission['approvername'];
		$data['status']=1;
		$integrals=D('Integral_rule')->getIntegralFormat($integral);
		$data['integrals']=serialize($integrals);
		$data['ticketnum']=count($integrals);
		$data['mission_id']=$mission['mission_id'];
		$ret=$this-> data($data) -> add();	
		return $ret;
	}
}